home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
UNIXLIB37B
/
!UnixLib37
/
src
/
unix
/
c
/
sync
< prev
next >
Wrap
Text File
|
1996-11-09
|
1KB
|
70 lines
/****************************************************************************
*
* $Source: /unixb/home/unixlib/source/unixlib37/src/unix/c/RCS/sync,v $
* $Date: 1996/11/06 22:01:42 $
* $Revision: 1.3 $
* $State: Rel $
* $Author: unixlib $
*
* $Log: sync,v $
* Revision 1.3 1996/11/06 22:01:42 unixlib
* Yet more changes by NB, PB and SC.
*
* Revision 1.2 1996/10/30 22:04:51 unixlib
* Massive changes made by Nick Burret and Peter Burwood.
*
* $Log: sync,v $
* Revision 1.3 1996/11/06 22:01:42 unixlib
* Yet more changes by NB, PB and SC.
*
* Revision 1.1 1996/04/19 21:35:27 simon
* Initial revision
*
***************************************************************************/
static const char rcs_id[] = "$Id: sync,v 1.3 1996/11/06 22:01:42 unixlib Rel $";
#include <errno.h>
#include <unistd.h>
#include <sys/os.h>
#include <sys/dev.h>
#include <sys/unix.h>
int
sync (void)
{
int r[3];
_kernel_oserror *e;
if (e = os_args (0xff, 0, 0, r))
{
__seterr (e);
return (-1);
}
return (0);
}
int
fsync (int fd)
{
int r[3];
_kernel_oserror *e;
register struct file *f;
if (BADF (fd))
{
errno = EBADF;
return -1;
}
f = __u->file + fd;
if (e = os_args (0xff, minor (f->dev), 0, r))
{
__seterr (e);
return -1;
}
return 0;
}